package com.note.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.note.domain.Content;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author Xiongx
 * @version 1.0
 * @date 2021/6/6 1:18
 * @since JDK 1.8
 */
public interface ContentMapper extends BaseMapper<Content> {

    @Select("select m_content.id,m_content.nid,m_note.title,m_note.tag,m_note.createtime,m_note.viewnum,m_note.isencrypt,m_content.content\n" +
            "from m_note,m_content WHERE m_note.id=m_content.nid and m_note.`deleted`=0 and m_content.nid=#{nid} limit 1")
    Content selectContentOne(@Param("nid")Integer nid);
}
